package com.panshi.qa.provider.modules.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panshi.qa.provider.modules.domain.ThType;
import com.panshi.qa.provider.modules.mapper.ThTypeMapper;
import com.panshi.qa.provider.modules.service.ThTypeService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ThTypeServiceImpl extends ServiceImpl<ThTypeMapper, ThType> implements ThTypeService {
    //查询全部问答口腔类型
    @Override
    public List<ThType> selectList() {
        return this.baseMapper.selectList(new QueryWrapper<ThType>().eq("type",20));
    }
    //查询指定问答口腔类型ID信息
    @Override
    public ThType selectById(Long typeId) {
        return this.baseMapper.selectOne(new QueryWrapper<ThType>().eq("id",typeId).eq("type",20));
    }
    //查询问答口腔类型的ID
    @Override
    public ThType queryQaTypeName(String typeName) {
        return this.baseMapper.selectOne(new QueryWrapper<ThType>().eq("name",typeName).eq("type",20));
    }
}
